package org.imis181.moqilintong.model.unary;

import lombok.NoArgsConstructor;

/**
 * 计算常用对数(以10为底)
 * @author moqilintong
 */
@NoArgsConstructor
public class Logarithm01 extends AbstractUnaryOperation01 {
    public Logarithm01(double oprand) {
        super(oprand);
    }

    @Override
    public double getResult() {
        return Math.log10(super.oprand);
    }

    @Override
    public String toString() {
        String template = "log(%f) = %f";
        return String.format(template, super.oprand, getResult());
    }
}
